<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>
	<button>get->info</button>
	<button>get->my</button>
	<button>post</button>
	<button>delete</button>
	<button>put</button>
</body>
<script>
	const btns = document.querySelectorAll("button");
	btns[0].onclick = function(){
		// ajax-->xhr fetch
		const xhr = new XMLHttpRequest();
		xhr.open("get","http://192.168.46.23:8089/info");
		xhr.send();
		xhr.onload = function(){
			console.log(xhr.response);
		}
	}
	btns[1].onclick = function(){
		// ajax-->xhr fetch
		const xhr = new XMLHttpRequest();
		xhr.open("get","http://192.168.46.23:8089/my");
		xhr.send();
		xhr.onload = function(){
			console.log(xhr.response);
		}
	}
	btns[2].onclick = function(){
		const xhr = new XMLHttpRequest();
		xhr.open("post","http://192.168.46.23:8089/info");
		xhr.setRequestHeader("Content-Type","application/json");
		xhr.setRequestHeader("a","1");
		xhr.send();
		xhr.onload = function(){
			console.log(xhr.response);
		}
	}
	btns[3].onclick = function(){
		const xhr = new XMLHttpRequest();
		xhr.open("delete","http://192.168.46.23:8089/info");
		xhr.setRequestHeader("Content-Type","application/json");
		xhr.setRequestHeader("a","1");
		xhr.send();
		xhr.onload = function(){
			console.log(xhr.response);
		}
	}
	btns[4].onclick = function(){
		const xhr = new XMLHttpRequest();
		xhr.open("put","http://192.168.46.23:8089/info");
		xhr.setRequestHeader("Content-Type","application/json");
		xhr.setRequestHeader("a","1");
		xhr.send();
		xhr.onload = function(){
			console.log(xhr.response);
		}
	}
</script>
</html>